﻿@model NWNT.Web.Controllers.MediaPartialModel
@{
    ViewBag.Title = Model.MediaType;
}
<h1>@ViewBag.Title</h1>
<!-- main content start -->
<div class="row">
    <!-- left col start -->
    <div class="col-md-9" id="col-left">
        <!-- ko if:$root.media.MediaId===0-->
        <!-- ko foreach: $root.media.PrimaryMediaPartial-->
        <div class="blogs">
            <div class="b-header"><a class="b-title" href="~/Testimonial/Testimonial" data-bind="attr:{href:('Media?mediaTypeId='+$root.media.MediaTypeId + '&mediaId='+$data.MediaId)}"><span data-bind="text:$data.Header1"></span>- <span data-bind="text:$data.Header2"></span></a></div>
            <p data-bind="html:$data.ShortText"></p>
            <div class="b-footer">
                <span class="b-date">Date:<label data-bind="text:moment($data.CreatedOn).format('DD-MMM-YYYY')"></label></span>
                <span class="b-share">Share this:</span>
                <ul class="share-media">
                    <li><a class="linkedin" href="#"></a></li>
                    <li><a class="twitter" href="#"></a></li>
                    <li><a class="youtube" href="#"></a></li>
                    <li><a class="fb" href="#"></a></li>
                </ul>
            </div>
        </div>
        <!-- /ko -->
        <!-- /ko -->
        <!-- ko if:$root.media.MediaId!==0-->
        <!-- ko if:$root.media.PrimaryMediaFull.VideoPath!==null-->
        <div class="row fullvideo">
            <div class="col-md-12">
                <iframe width="560" height="315" src="" data-bind="attr:{src: ('//'+ $root.media.PrimaryMediaFull.VideoPath)}" frameborder="0" allowfullscreen></iframe>
            </div>
        </div>
        <!-- /ko -->
        <div class="blogs">
            <div class="b-header">
                <h2><span data-bind="text:$root.media.PrimaryMediaFull.Header1"></span>- <span data-bind="text:$root.media.PrimaryMediaFull.Header2"></span></h2>
            </div>
            <p data-bind="html:$root.media.PrimaryMediaFull.LongText"></p>
            <div class="b-footer">
                <span class="b-date">Date:<label data-bind="text:moment($root.media.PrimaryMediaFull.CreatedOn).format('DD-MMM-YYYY')"></label></span>
                <span class="b-share">Share this:</span>
                <ul class="share-media">
                    <li><a class="linkedin" href="#"></a></li>
                    <li><a class="twitter" href="#"></a></li>
                    <li><a class="youtube" href="#"></a></li>
                    <li><a class="fb" href="#"></a></li>
                </ul>
                <span class="v-backto"><span class="glyphicon glyphicon-arrow-left"></span><a href="javascript:void(0);" data-bind="attr:{href:'Media?mediaTypeId='+$root.media.MediaTypeId}">back to media page</a></span>
            </div>
        </div>
        <!-- /ko -->
    </div>
    <!-- left col end -->
    <!-- right col start -->
    <div class="col-md-3 rnav-cont" id="col-right">
        @*@Html.Partial("_PartialNewsUpdates")*@
        <ul class="right-nav">
            <li class="rn-title">News Updates</li>
            <!-- ko foreach: $root.media.SecondaryMedia1-->
            <li><a id="news1" href="/NewsUpdates/Index" data-bind="attr:{href:('Media?mediaTypeId=2&mediaId='+$data.MediaId)}"><span data-bind="text:$data.Header1"></span>- <span data-bind="text:$data.Header2"></span></a></li>
            <!-- /ko -->
        </ul>
        <ul class="right-nav">
            <li class="rn-title">Blogs</li>
            <!-- ko foreach: $root.media.SecondaryMedia2-->
            <li><a id="news5" href="/Blogs/Index" data-bind="attr:{href:('Media?mediaTypeId=3&mediaId='+$data.MediaId)}"><span data-bind="text:$data.Header1"></span>- <span data-bind="text:$data.Header2"></span></a></li>
            <!-- /ko -->
        </ul>
    </div>
    <!-- right col end -->
</div>
<!-- main content end -->
<script type="text/javascript">
    var data = [@Html.Raw(Json.Encode(Model))];
    data = data[0];

    function MediaModel(media) {
        self = this;

        self.media = media;
    }
    var viewModel = new MediaModel(data);

    ko.applyBindings(viewModel);
</script>
